<template>
  <el-dialog
    width="80%"
    v-model="formVisible"
    title="新增任务"
    @close="formCancel"
  >
    <el-form
      ref="ruleFormRef"
      :model="form"
      :rules="rules"
      label-width="auto"
      class="demo-ruleForm"
      status-icon
    >
      <el-row :gutter="40" style="width: 100%">
        <el-col :span="12">
          <el-form-item label="提交主题" prop="name">
            <MSelect
              v-model="form.name"
              placeholder="请选择"
              :options="[]"
              class="select"
            />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="接受对象" prop="name">
            <MSelect
              v-model="form.name"
              placeholder="请选择"
              :options="[]"
              class="select"
            />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="佐证材料" prop="name">
            <MBackingMaterial
              v-model="form.files"
              dateFormat="YYYY-MM-DD HH:mm"
            />
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="处置结果描述" prop="name">
            <el-input
              v-model="textarea"
              :rows="2"
              type="textarea"
              placeholder="请输入处理情况"
              input-style="height: 200px"
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <div style="display: flex; justify-content: flex-end; width: 100%">
        <el-button @click="resetForm(ruleFormRef)">取消</el-button>
        <el-button type="primary" @click="submitForm(ruleFormRef)">
          确定
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup lang="ts">
import { reactive, ref } from 'vue'
import { Plus } from '@element-plus/icons-vue'
const formVisible = ref(false)

//新增
const form = reactive({
  name: '',
  files: []
})

const rules = ref({
  name: [{ required: true, message: '请输入', trigger: 'blur' }]
})

const save = () => {
  formVisible.value = true
}

const formCancel = () => {
  formVisible.value = false
}

const show = () => {
  formVisible.value = true
}

const PersonnelSelectionRef = ref(false)
//抽检人员
const open = () =>{
  PersonnelSelectionRef.value.show()
}
defineExpose({ show })
</script>

<style scoped lang="scss">
.search {
  display: flex;
  justify-content: space-between;
}
.btns {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 0;
}
.select {
  width: 480px;
}
</style>
